﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls" 
    xmlns:SampleData="clr-namespace:Expression.Blend.SampleData.LocationStore" 
    xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" 
    xmlns:SampleData1="clr-namespace:Expression.Blend.SampleData.Directions" 
    x:Class="TestingWP7.NearByPage"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

	<phone:PhoneApplicationPage.Resources>
		<SampleData1:Directions x:Key="Directions" d:IsDataSource="True"/>
		<SampleData:LocationStore x:Key="LocationStore" d:IsDataSource="True"/>
		<DataTemplate x:Key="ItemTemplate">
			<StackPanel Orientation="Horizontal" Width="460" Margin="0,0,0,12">
				<Image Source="{Binding ImageUrl}" Height="90" Width="90" Margin="5,0"/>
				<StackPanel Margin="0,0,6,0" Width="290" MouseLeftButtonUp="StackPanel_MouseLeftButtonDown">
					<TextBlock Text="{Binding LocationName}" d:LayoutOverrides="Height" FontFamily="Segoe WP" FontSize="21.333" FontWeight="Bold" TextWrapping="Wrap"/>
					<TextBlock Text="{Binding Address}" d:LayoutOverrides="Height" TextWrapping="Wrap"/>
					<TextBlock Text="{Binding Miles}" d:LayoutOverrides="Height"/>
				</StackPanel>
				<Image Height="60" Source="icons/phone_icon.png" Width="60" Margin="0" MouseLeftButtonUp="Image_MouseLeftButtonDown"/>
			</StackPanel>
		</DataTemplate>
		<DataTemplate x:Key="ItemTemplate1">
			<StackPanel Margin="17,0,7,10">
				<StackPanel Height="64" Orientation="Horizontal">
					<Image Source="{Binding icon}" Width="64" HorizontalAlignment="Left" Margin="0,0,23,0"/>
					<TextBlock Text="{Binding path}" d:LayoutOverrides="Height" VerticalAlignment="Center" TextWrapping="Wrap"/>
				</StackPanel>
				<StackPanel Orientation="Horizontal">
					<Path Data="M88.5,71 L349.5,92" Stretch="Fill" UseLayoutRounding="False" Width="329" Height="1" Stroke="#FFB6B6B6"/>
					<TextBlock Text="{Binding distance}" d:LayoutOverrides="Width" Margin="15,0,0,0"/>
				</StackPanel>
			</StackPanel>
		</DataTemplate>
	</phone:PhoneApplicationPage.Resources>
 
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
            <shell:ApplicationBarIconButton IconUri="/icons/appbar.feature.camera.rest.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

	<phone:PhoneApplicationPage.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</phone:PhoneApplicationPage.FontFamily>
	<phone:PhoneApplicationPage.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</phone:PhoneApplicationPage.FontSize>
	<phone:PhoneApplicationPage.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</phone:PhoneApplicationPage.Foreground>

	<Grid x:Name="LayoutRoot" Background="Transparent" DataContext="{Binding Source={StaticResource LocationStore}}">
		<Grid x:Name="ContentPanel">
        	      
			<controls:Pivot Title="nearby">
				<controls:PivotItem Header="coffee">
					
					<Grid>
						<ListBox x:Name="lbNearBy" ItemTemplate="{StaticResource ItemTemplate}" ItemsSource="{Binding Collection}"/>
					</Grid>
				</controls:PivotItem>
				<controls:PivotItem Header="favourite" DataContext="{Binding Source={StaticResource Directions}}">
					<Grid>
						<StackPanel Orientation="Vertical" d:LayoutOverrides="Height">
							<StackPanel Orientation="Horizontal" Margin="17,0,0,0" HorizontalAlignment="Left" Width="417">
								<Image Source="/icons/appbar.feature.camera.rest.png" Width="60" Height="60"/>
								<StackPanel Orientation="Vertical" Margin="24,0,-356,0">
									<TextBlock TextWrapping="Wrap" Text="Nguyen Thi Minh Khai" d:LayoutOverrides="Width" FontWeight="Bold"/>
									<TextBlock TextWrapping="Wrap" Text="Thanh Pho Ho Chi Minh, Viet Nam"/>
								</StackPanel>
							</StackPanel>
							<Path Data="M88.5,71 L349.5,92" Stretch="Fill" UseLayoutRounding="False" Height="1" Stroke="#FFB6B6B6" Margin="16,13,33,13"/>
							<ListBox ItemTemplate="{StaticResource ItemTemplate1}" ItemsSource="{Binding Collection}" Height="535"/>
							<StackPanel Orientation="Horizontal" Margin="17,0,0,0" HorizontalAlignment="Left" Width="417">
								<Image Source="/icons/appbar.feature.camera.rest.png" Width="60" Height="60"/>
								<StackPanel Orientation="Vertical" Margin="24,0,-356,0">
									<TextBlock TextWrapping="Wrap" Text="Gloria Jeans" d:LayoutOverrides="Width" FontWeight="Bold"/>
									<TextBlock TextWrapping="Wrap" Text="106 Nguyen Thi Minh Khai, Quan 3, Ho Chi Minh"/>
								</StackPanel>
							</StackPanel>
						</StackPanel>
					</Grid>
				</controls:PivotItem>
			</controls:Pivot>
        	      
		</Grid>
	</Grid>

</phone:PhoneApplicationPage>
